< previous page page_28 next page >

Page 28
You can specify any or all optional parameters. If any are omitted, however, the default values are used. If you omit one of the parameters, you must use a comma as a place-holder. To modify the code in the preceding example to play the animation four times and only the first ten frames, you should change the Play method:
anmAnimation1.Open strAVIFile, 4,, 10
Finally, it's a good practice to use the Close method when you're finished using an animation file. However, it's not necessary to close one file before opening another.
UpDown
The UpDown control is a new twist to an old friend. Previous releases of Visual Basic had a Spin control, which let users click an up or down arrow. What action was taken as a result was entirely up to you. If you wanted to have a number change when the Spin control was clicked (as in the number of copies in a Print dialog box), you would need the following code to perform the action:
Private Sub Spin1_SpinDown()
    entcopies.Text = entcopies.Text - 1
End Sub

Private Sub Spin1_SpinUp()
    entcopies.Text = entcopies.Text + 1
End Sub
As you can see, the code that you write controls exactly what the Spin control action will be. The UpDown control is now the control to use when this type of interaction is required. For some types of actions, such as manipulating dates, you still need to code the UpClick and DownClick routines to perform the required actions. For more basic scrolling type functionality, the UpDown control increments or decrements a value displayed in a buddy control. This control is very useful when you're asking the user to enter a number to control a certain action in the application.
To add the UpDown control to your application, make sure that the Windows Common Controls 2 file is added to your project. Then select the UpDown control from the toolbox, as shown in Figure 1.16.

 
< previous page page_28 next page >

If you like this book, buy it!